from itsdangerous import TimedJSONWebSignatureSerializer
from django.conf import settings
# 6.使用 itsdangerous 加解密
# 1.导包 from itsdangerous import TimedJSONWebSignatureSerializer
# 2. 实例化 serializer = Serializer(secret_key='abc', expires_in=24 * 15 * 60)
# 3. 加密serializer.dumps() --注意:返回是 bytes
# 4. 解密serializer.loads()

serializer = TimedJSONWebSignatureSerializer(secret_key=settings.SECRET_KEY, expires_in=15 * 60)
